<?php
/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/8/24 15:28
 * Desc:
 */
/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/8/21 17:08
 * Desc:酒店参数验证
 */
class Request_Api_V2_Food extends Request_Api_V2_Base
{
    public function __construct($request_param)
    {
        parent::__construct($request_param);
    }

    public function query()
    {
        $this->rules = [
            ['dest_id', ['digit', $this->rule_min(0)]],
            ['page', ['digit', $this->rule_min(1)]],
            ['pagesize', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function second_category()
    {
        $this->rules = [
            ['category_id', ['digit', $this->rule_min(0)]],
        ];

        return $this;
    }


    public function index_attr()
    {
        $this->rules = [
            ['dest_id', ['digit', $this->rule_min(0)]],
            ['row', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_detail()
    {
        $this->rules = [
            ['id', ['not_empty','digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_suit_detail()
    {
        $this->rules = [
            ['suit_id', ['not_empty','digit', $this->rule_min(1)]],
            ['together_id', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function add_order()
    {
        $this->rules = [
            ['product_id', ['not_empty','digit', $this->rule_min(1)]],
            ['suit_id', ['not_empty','digit', $this->rule_min(1)]],
            ['dingnum', ['not_empty','digit', $this->rule_min(1)]],
            ['linktel', ['phone']],
            ['linkemail', ['email']],
        ];

        $this->validation->rule('mid',array('Rule_Member','need_member'));

        return $this;
    }

    public function add_discount_order()
    {
        $this->rules = [
            ['product_id', ['not_empty','digit', $this->rule_min(1)]],
            ['consume_total', ['not_empty','money', $this->rule_min(0.01)]],
        ];

        $this->validation->rule('mid',array('Rule_Member','need_member'));

        return $this;
    }


}